package MyGui;

import javax.swing.*;
import java.awt.event.*;

import DistSys.SysConst;

/**
 * Title:        iPAD
 * Description:
 * Copyright:    Copyright (c) 2002
 * Company:      ABB Inc.
 * @author Fangxing Li
 * @version 1.0
 */

public class MyPopupMenu2 extends JPopupMenu {
    MainFrame mainFrame;

    private JMenuItem mnuQuickFlow, mnuNetFlow, mnuSecurity, mnuShortCkt,
                      mnuDistRel, mnuNetRel;

    public MyPopupMenu2(MainFrame mainFrame) {
        this.mainFrame = mainFrame;
        this.setFont( GuiConst.fontDefault);
        try {
            mnuQuickFlow = new JMenuItem("Radial Power Flow");
            mnuQuickFlow.setFont( GuiConst.fontDefault);
            mnuQuickFlow.addActionListener(mainFrame.menuBar.alQuickFlow);
            add(mnuQuickFlow);
            mnuNetFlow = new JMenuItem("Network Power Flow");
            mnuNetFlow.setFont( GuiConst.fontDefault);
            mnuNetFlow.addActionListener(mainFrame.menuBar.alNetFlow);
            add(mnuNetFlow);
            mnuSecurity = new JMenuItem("Security Assessment");
            mnuSecurity.setFont( GuiConst.fontDefault);
            mnuSecurity.addActionListener(mainFrame.menuBar.alSecurity);
            add(mnuSecurity);
            addSeparator();

            mnuShortCkt = new JMenuItem("Short Circuit");
            mnuShortCkt.setFont( GuiConst.fontDefault);
            mnuShortCkt.addActionListener(mainFrame.menuBar.alShtCkt);
            add(mnuShortCkt);
            addSeparator();

            mnuDistRel = new JMenuItem("Radial Reliability Assessment");
            mnuDistRel.setFont( GuiConst.fontDefault);
            mnuDistRel.addActionListener(mainFrame.menuBar.alDistRel);
            add(mnuDistRel);
            mnuNetRel = new JMenuItem("Network Reliability Assessment");
            mnuNetRel.setFont( GuiConst.fontDefault);
            mnuNetRel.addActionListener(mainFrame.menuBar.alNetRel);
            add(mnuNetRel);
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }
}